Counting Inversions